<!DOCTYPE html>
<!-- saved from url=(0037)http://127.0.0.1/wx/ybss/zhuce/zc.jsp -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <title>修改地址</title>

  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no, email=no">
  <!--[if IE]>
  <script src="http://127.0.0.1:80/wx/ybss/js/html5shiv.min.js"></script>
  <![endif]-->


  <script type="text/javascript" src="../../script/constants.js"></script>
  <script src="../resource/md5.js"></script>
  <script src="../resource/jquery214.js"></script>
  <script src="../resource/fastclick.js"></script>
  <script src="../resource/jqueryweui.js"></script>
  <script src="../resource/picker.js"></script>
  <script src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/aes.js"></script>
  <script type="text/javascript" charset="UTF-8" src="../../script/naes.js"></script>
  <script type="text/javascript" src="../../script/modeecb.js"></script>
  <script src="../../script/tmd5.js"></script>
  <script>


  </script>

  <style>

   body {
    overflow-x:hidden;
    margin: 0;
   }
   html {
    overflow-x:hidden;
   }
   input:focus {
       border: 1px solid #27a8fa;
   }

  </style>

</head>

<body style="background:#F4F4F4;">
<div>
  <div>
        <header id="statusBar">
		<div style="width:100%;display:table;background: #fff;position:fixed;border-bottom:1px solid #EAEAEA;z-index: 9999;height: 50px;" >
			<div style="float:left;width: 20%;height: 50px;line-height: 50px;" tapmode="presshover" onclick="api.closeWin();">
			  <div style="float:left;width: 30%;height: 50px;">
			   <img style="width: 24px;margin-top: 13px;" src="../../image/blc_back.png" />
			   </div>
			   <div style="float:left;width: 50%;">
			   返回
			   </div>
			</div>
			<div style="float:left;width: 60%;height: 50px;line-height: 50px;text-align: center;font-weight:bold;">
			 修改地址
			</div>
			<div style="float:left;width: 20%;height: 50px;line-height: 50px;text-align: center;color: #27a8fa" tapmode="presshover" onclick="updateAddr();">
			  完成
			</div>
		</div>
		</header>
		
        <div style="height:70px"></div>
        <div>
         <input id="addr" style="float:left;width:100%;height:30px;padding:5px;font-size: 16px;border:0px;" placeholder="请填写店铺地址"/>
        </div>
<input type="hidden" id="merid"/>
         <div style="clear: both;">
         </div>
</div>
		<div style="bottom:0;margin-top: 20px;width:100%;height:50px;text-align: center;">四川航天信息有限公司</div>
</div>		
<script>
    var addr = "";
    var merid = "";
	apiready = function(){
	  api.parseTapmode();
	  if(api.systemType == "ios"){
		   document.getElementById("statusBar").style.background = "#298cb4";
		}
	  $api.fixStatusBar( $api.dom('header') );
      addr = api.pageParam.addr;
      merid = api.pageParam.merid;
      $("#addr").val(addr);
      $("#merid").val(merid);
    }
     
    function updateAddr(){
       var address = $("#addr").val();
       if(address == ""){
          api.alert({msg: "请填写店铺地址！"});
          return;
       }
       var callback = function(ret, err){
        //console.log(JSON.stringify(ret));
           if(ret){
              if(ret.success == true){
                 api.alert({msg: "修改成功"});
                 api.sendEvent({
		                name:'updateAddr'
	             });
	             api.closeWin();
              }else{
                 api.alert({msg: "修改失败"});
              }
           }else{
              api.alert({msg: JSON.stringify(err)});
           }
       }
	   var content = {"merid":merid,"addr":address};
	   apiAjax(JSON.stringify(content),url.updateAddr,callback);
    } 

</script>



</body></html>
